/**
 * demo
 * 2016-08-07
 */

var APP = angular.module('APP', [
    'ngRoute',
    'chieffancypants.loadingBar'
])
.config(['$routeProvider', 'cfpLoadingBarProvider', function($routeProvider, cfpLoadingBarProvider) {
    // 路由表
    $routeProvider.when('/index', {
      templateUrl: 'views/demo.html',
      controller: 'demoCtrl'
    })
    .otherwise({
        redirectTo: '/index'
    });

    // loading-bar 配置
    cfpLoadingBarProvider.includeSpinner = true;
    cfpLoadingBarProvider.includeBar = true;
}]) 
.filter('doubleNumberFilter', function() {
    return function(num) {
        if (num < 10) {
            num = '0' + num;
        }

        return num;
    };
});